1. Field of the Invention
The present invention relates to an apparatus and method for generating and restoring an RTP (Real-Time Transport Protocol) packet for transmitting an MPEG (Moving Picture Experts Group)-4 stream, and more particularly, to an apparatus and method capable of effectively encapsulating a plurality of SL (Synchronization Layer) packets for transmitting the MPEG-4 stream within an RTP packet.
2. Description of the Related Art
The Internet engineering task force (IETF) is an entity for defining a standard of an Internet operating protocol such as a TCP/IP (Transmission Control Protocol/Internet Protocol), and has subgroups assigned to each technical field. An RTP format for making the MPEG-4 stream a multiple synchronization layer (SL) packet and transmitting the same using a real-time transport protocol (RTP) is described in Draft-I ETF-AVT-MPEG4-MULTISL-02.TXT.
Presently, a conceptual SL is defined in order to store transmission characteristics information such as time stamp and random access. When a MPEG-4basic stream is transmitted, transmission information from the SL is generally mapped to a transmission layer.
FIG. 1 is a drawing illustrating an RTP packet within which a plurality of SL packets is included. Referring to FIG. 1, the RTP packet 100 includes an RTP packet header 110, a mapped SL header 120, a residual SL packet header 130, and an SL packet payload 140.
The RTP packet header 110 has a fixed size and is followed by a specific information and data. Each field (not shown) will be briefly described in the following. A V field, is a version field and a P field is used for constructing a packet having 32 bits. An X field represents whether the header is extended, and a CC field represents a number of a CSRC (Contributing source identifier). An M field is a frame region for multimedia information. Namely, the M field is used for distinguishing voice from image information within the packet. A PT field denotes an RTP payload type of a profile defined by an RFC 1890 and interpreted by an application program. A sequence number field represents an order of the RTP packet, and a time stamp field represents a time point where sampling is made for a first octet of the RTP packet. An SSRC (Synchronization Source) field represents an identifier of a data source such as a camera and a microphone, and a CSRC field represents an identifier capable of distinguishing the sources in the case the RTP packets are mixed in an intermediate system.
FIG. 2 is a drawing illustrating an embodiment of a structure of a mapped SL header. The mapped SL header 120 includes: a payload size field 210, an index/index delta field 220, a composition time stamp flag (CTSFlag) field 230, a composition time stamp delta (CTSDelta) field 240, a decoding time stamp Flag (DTSFlag) field 250, and a decoding time stamp delta (DCTSDelta) field 260.
A size of a related SL packet located in the same RTP packet, is expressed in terms of a byte and stored in the payload size field 210. If the SL packet is divided, a payload size is a size of the whole SL packet.
On the index/index delta field 220, a serial number of a divided SL packet is recorded. The serial number of the SL packet is increased by one. The serial number is recorded on a first SL header only and is not recorded on a subsequent SL header. To encode the serial number on an SL header other than the first SL header, the index/index delta field 220 is used. On the index/index delta field 220, a difference in serial number between the present SL packet and the previous SL packet is recorded. Therefore, a serial number of an nth SL packet is obtained by adding one to a sum of an index of an n-1th SL packet and an index delta value of an nth SL packet. If each index/index delta field 220 is set to zero, a serial number of the SL packet is regarded as not specified, and a receiver ignores the index/index delta field 220.
On the CTSFlag field 230, whether the CTS delta exists is recorded. If the CTSFlag is one, the CTS delta exists, and the CTSFlag is zero, the CTS delta does not exist. If a CTS delta length is not zero, the CTS delta field 240 exists regardless of whether the SL packet is a beginning of a connection unit, and a value of the CTSFlag field 230 is zero for the first SL header and one for the SL headers after the first SL header. A size of the CTSFlag field 230 is one bit.
On the CTS delta field 240, a CTS value as expressed in terms of a complementary number of two for the time stamp existing within the RTP header of the RTP packet, is recorded. A number of bits for each CTS delta field 240 is specified by a CTS delta length parameter. Since the CTS of the first SL packet within the RTP packet is mapped as an RTP time stamp, the CTSFlag of a first multiple SL packet header for each RTP packet is always zero.
On the DTSFlag field 250, whether the DTS delta exists is recorded. If the DTSFlag is one, this indicates that the DTS delta exists, and if the DTSFlag is zero, this means that the DTS delta does not exist. A receiver requires the DTSFlag in order to reconstruct the decoding time stamp of the SL header. If the DTS delta length is not zero, the DTS delta field 260 exists regardless of whether the SL packet is a beginning of a connection unit, and a value of the DTSFlag field 250 is zero for the first SL header and one for the SL headers after the first SL header.
On the DTS delta field 260, a DTS delta, a value achieved by subtracting a decoding time from a generating time, is recorded. The DTS delta encodes the same SL packet and is always a positive number. A number of bits for each DTS delta field 260 is specified by a DTS delta length parameter. If the DTS delta is zero, namely, the generating time is the same as the decoding time, then the DTSFlag is zero and the DTS delta field 260 does not exist. A transmission side calculates the DTS delta, considering roll-over. For example, for an SL stream having (CTS,DTS) pairs such as (4,3), (5,4), (6, 5), (7,6), and (0,7), where a time stamp length is three, the DTS delta for the last pair should be one, not minus seven.
The residual SL packet header 130 is a residual portion after the SL packet is modified to map to the payload format mentioned above. On the residual SL packet 130, information not mapped to the RTP header 110 or to the mapped SL packet header 120 is recorded. For example, the CTSFlag, the CTS, DTSFlag, DTS, and the serial number are eliminated, but an access unit end flag (AUEF) is not eliminated since the AUEF is useful information marking an end of each connection unit. Also, if the SL packet header includes an OCR, the OCR is expressed in terms of a complementary number difference of two, and is stored in the residual SL packet 130. If the CTS does not exist for the SL packet having the OCR, the OCR is encoded as a difference between the RTP time stamp and the OCR. For a stream using an additional downward priority field within the SL packet header, only one SL packet having the same downward priority is transmitted by a single RTP packet in order to transmit the RTP packet according to appropriate QoS (Quality of Service). Further, only one first residual SL header of one RTP packet has the downward priority field. On the SL packet payload 140, an MPEG-4 stream transmitted through the RTP packet is accommodated.
If a plurality of the SL packets is mapped to the RTP packet as described above, the duplicated portion of the SL packet header and the RTP packet header are preferably eliminated to avoid unnecessary overhead. An MPEG-4 system of a related art achieves synchronization using a parameter provided by the RTP header. If the SL header is used, a duplicate field is eliminated from the SL header. The rest of the information of the SL header that is eliminated by elimination of the duplicate field is accommodated within the payload of the RTP packet, together with the payload of the SL packet.
For reference, a method of restoring multiple SL packets of a related art to restore the multiple SL packets generated by the foregoing criterion, is as follows. A packet sequence number for a first packet of the multiple SL packet is zero and becomes an index. A packet sequence number for the remaining SL packet, is a value achieved by summing one, a sum of a packet sequence number of a previous packet and an index delta of a relevant SL packet.
As a difference value is recorded for the CTS and the DTS, a time stamp flag is used to restore them. The RTP time stamp is 32 bits, and the RTP time stamp is mapped into a variety of the SL time stamp values. If the SL time stamp exceeds 32 bits, the lowest bit of the RTP time stamp becomes the SL time stamp. However, if a SL time stamp is less than 32 bits, the SL time stamp becomes a value achieved by sequentially summing an integer starting at zero, to an RTP time stamp. If the SL time stamp is 32 bits, the RTP time stamp is mapped unchanged.
If the CTS delta length is not defined and the time stamp is used, the CTSFlag of a first SL packet within the RTP packet becomes one, and the RTP time stamp is mapped into the CTS. In the meantime, if the CTS delta length is not defined and the time stamp is not used, the CTSFlag of the first SL packet and the CTS are ignored. At the moment, the CTSFlag and the CTS field for the remaining SL packets remain empty.
On the contrary, if the CTS delta length is defined, the time stamp is used, and if the connection unit beginning flag is one, the time stamp of the multiple SL packet becomes the CTSFlag, and a sum of the CTS delta of the multiple SL packet and the time stamp of the SL packet becomes the CTS. If the CTS delta length is defined, the time stamp is used, and if the connection unit beginning flag is not one, then the CTSFlag is ignored. However, if the CTS delta length is defined and the time stamp is not used, the reception side ignores the CTSFlag.
In case that the DTS delta length is not defined, if the time stamp is used and the connection unit beginning flag is one, then the DTSFlag is zero. On the contrary, in case that the DTS delta length is not defined, if the time stamp is used and the connection unit beginning flag is not one, then the DTSFlag is ignored. In the meantime, in case that the DTS delta length is defined, if the time stamp is used and the connection unit beginning flag is one, then the DTSFlag becomes the DTS flag of the multiple SL packet header, and the DTS becomes a value achieved by subtracting the DTS delta of the multiple SL packet header from the CTS. On the contrary, in case that the DTS delta length is defined, if the time stamp is used and the connection unit beginning flag is not one, the DTSFlag is ignored. If the DTS delta length is defined, but the time stamp is not used, the reception side ignores the DTSFlag.
The method of generating a multiple SL packet in the related art, however, does not sufficiently utilize the 32 bit length of the RTP time stamp if the length of the time stamp is less than 32 bits. Also, if the CTS value rolls over, the CTS delta value increases, so that a reduction in a number of bits, the purpose of using the CTS delta value, is not accomplished. For the SL packets having a time stamp's length l greater than 32 bits, the method of generating a multiple SL packet in the related art cannot be used. Further, the method of the related art is problematic since a negative number may appear upon generation of roll-over of the CTS or the DTS, and that negative number may possibly increase.